415C - Mashmokh and Numbers - CodeForces Solution


constructive algorithms greedy number theory *1500

Please click on ads to support us..

Python Code:

import collections
import heapq
import sys
import math
import itertools
import bisect
from io import BytesIO, IOBase
import os

 
def value(): return tuple(map(int, input().split()))
def values(): return tuple(map(int, sys.stdin.readline().split()))
def inlst(): return [int(i) for i in input().split()]
def inlsts(): return [int(i) for i in  sys.stdin.readline().split()]
def inp(): return int(input())
def inps(): return int(sys.stdin.readline())
def instr(): return input()
def stlst(): return [i for i in input().split()]
    
 
  
def solve():
    nn,k=value()
    if nn%2==1 :
        n=nn-1 
    else :
        n=nn
    if nn==1 :
            if k==0:print(1)
            else:print(-1)
            return
    if  k<n//2:
            print(-1)
            return 
    gfirst=k-(-1+(n//2))
    l=[]
    l.append(gfirst)
    l.append((gfirst*2))
    for i in range(2,nn):
            l.append((l[-1]+1))
    print(*l)


 
solve()


Comments

Submit
0 Comments
More Questions

13 Reasons Why
Friend's Relationship
Health of a person
Divisibility
A. Movement
Numbers in a matrix
Sequences
Split houses
Divisible
Three primes
Coprimes
Cost of balloons
One String No Trouble
Help Jarvis!
Lift queries
Goki and his breakup
Ali and Helping innocent people
Book of Potion making
Duration
Birthday Party
e-maze-in
Bricks Game
Char Sum
Two Strings
Anagrams
Prime Number
Lexical Sorting Reloaded
1514A - Perfectly Imperfect Array
580A- Kefa and First Steps
1472B- Fair Division